home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / misc / sstring.h < prev    next >
C/C++ Source or Header  |  1996-08-03  |  1KB  |  64 lines

  1. #pragma interface
  2. #ifndef SSTRING_H
  3. #define SSTRING_H
  4.  
  5. // Simple string class
  6. class SSTRING: public ARRAY_OBJ {
  7.     char *str;
  8.     int maxsiz;        // 0 if not specified
  9.     /*~PROTOBEG~ SSTRING */
  10. public:
  11.     SSTRING (const SSTRING&_str);
  12.     SSTRING (const char *_str);
  13.     SSTRING (const char *_str, int _maxsiz);
  14.     SSTRING (void);
  15.     void append (const char *app);
  16.     int cmp (const SSTRING&other)const;
  17.     int cmp (const char *other)const;
  18.     void copy (SSTRING&dst)const;
  19.     void copy (char *dst)const;
  20.     char *copyword (const char *line);
  21.     const char *get (void)const;
  22.     int getlen (void)const;
  23.     int getmaxsiz (void)const;
  24.     int getval (void)const;
  25.     int icmp (const SSTRING&other)const;
  26.     int icmp (const char *other)const;
  27.     int is_empty (void)const;
  28.     int ncmp (const char *other, int len)const;
  29.     SSTRING&operator = (const SSTRING&_str);
  30.     void setfrom (const SSTRING&src);
  31.     virtual void setfrom (const char *src);
  32.     void setfrom (int val);
  33.     void setmaxsiz (int size);
  34.     const char *strchr (char carac);
  35.     void strip_end (void);
  36.     ~SSTRING (void);
  37.     /*~PROTOEND~ SSTRING */
  38. };
  39.  
  40. // table of SSTRING
  41. class SSTRINGS: public ARRAY {
  42.     /*~PROTOBEG~ SSTRINGS */
  43. public:
  44.     SSTRING *getitem (int no)const;
  45.     int lookup (const SSTRING *str)const;
  46.     int lookup (const char *str)const;
  47.     void sort (void);
  48.     /*~PROTOEND~ SSTRINGS */
  49. };
  50.  
  51. /*
  52.     A string with a comment
  53. */
  54. class CSSTRING: public SSTRING{
  55. public:
  56.     SSTRING comment;
  57.     /*~PROTOBEG~ CSSTRING */
  58. public:
  59.     void setcomment (const SSTRING&com);
  60.     /*~PROTOEND~ CSSTRING */
  61. };
  62.  
  63. #endif
  64.